/*
 * FileNameFilterWrapper.java
 *
 * Created on August 20, 2006, 2:07 AM
 *
 * When one filename filter is not enough...
 */
package custom.io;

import java.io.File;
import java.io.FilenameFilter;

/**
 *
 * @author david
 */
public class FileNameFilterWrapper implements FilenameFilter {

    FilenameFilter[] filenameFilters;

    /**
     * Creates a new instance of FileNameFilterWrapper
     */
    public FileNameFilterWrapper(FilenameFilter[] filenameFilters) {
        this.filenameFilters = filenameFilters;
    }

    public boolean accept(File dir, String name) {
        boolean status = true;

        for (int i = 0; (status == true) && (i < filenameFilters.length); ++i) {
            status = filenameFilters[i].accept(dir, name);
        }

        return status;
    }
}
